//
//  StayHotelCell.m
//  Traveling
//
//  Created by Northwan on 15/6/4.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "StayHotelCell.h"
@interface StayHotelCell()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitle;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UIImageView *wifiView;
@property (weak, nonatomic) IBOutlet UIImageView *breakfastView;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end
@implementation StayHotelCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static  NSString  *CellIdentiferId = @"StayHotelCell";
    StayHotelCell  *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentiferId];
    if (cell == nil) {
        NSArray *nibs = [[NSBundle mainBundle]loadNibNamed:@"StayHotelCell" owner:nil options:nil];
        cell = [nibs lastObject];
    }
    return cell;
}

- (void)awakeFromNib {
    // Initialization code
}

-(void)initData:(HotelStayResult *)result{
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:result.cover_img]];
    [self.titleLabel setText:result.hotel_name];
    [self.subTitle setText:result.address];
    [self.phoneLabel setText:result.tel];
    if(ISBLANK(result.breakfast)){
        [self.breakfastView setHidden:YES];
    }else{
        [self.breakfastView setHidden:NO];
    }
    if(ISBLANK(result.broadband)){
        [self.wifiView setHidden:YES];
    }else{
        [self.wifiView setHidden:NO];
    }
    [self.priceLabel setText:[NSString stringWithFormat:@"%.2f",result.low_price]];
}

@end
